<template>
  <div class="measure--focus--bar">
    <div class="measure--focus--bar--head">
      <div
        :class="[
          'measure--focus--head--item one',
          { active: which == 'measure' },
        ]"
        @click="choseBar('measure')"
      >
        常规测量
      </div>
      <div
        :class="[
          'measure--focus--head--item two',
          { active: which == 'focus' },
        ]"
        @click="choseBar('focus')"
      >
        疑似病灶
      </div>
    </div>
    <div class="measure--focus--con">
      <div class="measure--focus--con--item" v-show="which == 'measure'">
        <ArteryMeasure
          v-if="pos == '颈动脉'"
          :scanIMTInfo="scanIMTInfo"
          :psedInfo="psedInfo"
          size="small"
        />
        <ThyroidMeasure
          v-if="pos == '甲状腺'"
          :thyroid_measure="thyroid_measure"
          size="small"
        />
        <AbaomenMeasure
          v-if="pos == '腹部' || pos == '消化系'"
          :digestiveMeasure="abdomenMeasure"
          size="small"
        />
        <BreastMeasure
          v-if="pos == '乳腺'"
          :breastMeasure="breastMeasure"
          size="small"
        />
        <UrinaryMeasure
          v-if="pos == '泌尿'"
          :Measure="urinaryMeasure"
          size="small"
        />
      </div>
      <div class="measure--focus--con--item" v-show="which == 'focus'">
        <ArteryTubcle
          v-if="pos == '颈动脉'"
          :plaque__measure="plaque__measure"
          size="small"
        />
        <ThyroidTubrcle
          v-if="pos == '甲状腺'"
          :thyroid_measure="thyroid_measure"
          size="small"
        />
        <AbaomenTubcle
          v-if="pos == '腹部' || pos == '消化系'"
          :digestiveTubercle="abdomenTubercle"
          size="small"
        />
        <BreastTubcle
          v-if="pos == '乳腺'"
          :breastTubercle="breastTubercle"
          size="small"
        />
        <UrinaryTubcle
          v-if="pos == '泌尿'"
          :Tubercle="urinaryTubercle"
          size="small"
        />
      </div>
    </div>
  </div>
</template>

<script>
import ArteryMeasure from "@/components/ArteryMeasure";
import ArteryTubcle from "@/components/ArteryTubcle";
import ThyroidTubrcle from "@/components/ThyroidTubrcle";
import ThyroidMeasure from "@/components/ThyroidMeasure";
import AbaomenMeasure from "@/components/AbaomenMeasure";
import AbaomenTubcle from "@/components/AbaomenTubcle";
import UrinaryMeasure from "@/components/UrinaryMeasure";
import UrinaryTubcle from "@/components/UrinaryTubcle";
import BreastMeasure from "@/components/BreastMeasure";
import BreastTubcle from "@/components/BreastTubcle";
export default {
  name: "ReportMeasure",
  props: ["show", "pos", "measureInfo"],
  data() {
    return {
      which: "measure", //focus
    };
  },
  computed: {
    MeasureInfo() {
      if (this.measureInfo) {
        return JSON.parse(this.measureInfo);
      } else {
        return {};
      }
    },
    scanIMTInfo() {
      if (this.MeasureInfo.scanIMTInfo) {
        return this.MeasureInfo.scanIMTInfo;
      } else {
        return {};
      }
    },
    psedInfo() {
      if (this.MeasureInfo.psedInfo) {
        return this.MeasureInfo.psedInfo;
      } else {
        return {};
      }
    },
    plaque__measure() {
      if (this.MeasureInfo.plaque__measure) {
        return this.MeasureInfo.plaque__measure;
      } else {
        return {};
      }
    },
    thyroid_measure() {
      if (this.MeasureInfo.thyroid_measure) {
        return this.MeasureInfo.thyroid_measure;
      } else {
        return {};
      }
    },
    abdomenMeasure() {
      if (this.MeasureInfo.abdomenMeasure) {
        return this.MeasureInfo.abdomenMeasure;
      } else {
        return {};
      }
    },
    abdomenTubercle() {
      if (this.MeasureInfo.abdomenTubercle) {
        return this.MeasureInfo.abdomenTubercle;
      } else {
        return {};
      }
    },
    breastMeasure() {
      if (this.MeasureInfo.breastMeasure) {
        return this.MeasureInfo.breastMeasure;
      } else {
        return {};
      }
    },
    breastTubercle() {
      if (this.MeasureInfo.breastTubercle) {
        return this.MeasureInfo.breastTubercle;
      } else {
        return {};
      }
    },
    urinaryMeasure() {
      if (this.MeasureInfo.urinaryMeasure) {
        return this.MeasureInfo.urinaryMeasure;
      } else {
        return {};
      }
    },
    urinaryTubercle() {
      if (this.MeasureInfo.urinaryTubercle) {
        return this.MeasureInfo.urinaryTubercle;
      } else {
        return {};
      }
    },
  },
  components: {
    ArteryMeasure,
    ArteryTubcle,
    ThyroidTubrcle,
    ThyroidMeasure,
    AbaomenMeasure,
    AbaomenTubcle,
    BreastMeasure,
    BreastTubcle,
    UrinaryMeasure,
    UrinaryTubcle,
  },
  watch: {
    show(val) {
      if (val) {
        this.which = `measure`;
      }
    },
  },
  methods: {
    choseBar(type) {
      if (type) {
        this.which = type;
      }
    },
  },
};
</script>

<style scoped lang="less">
.measure--focus--bar {
  width: 100%;
  font-family: "Microsoft YaHei", "Arial Negreta", "Arial Normal", "Arial";
  user-select: none;
  display: flex;
  flex-direction: column;
  height: calc(100% - 47px);
  .measure--focus--bar--head {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 10px;
  }
  .measure--focus--head--item {
    width: 120px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: rgba(127, 127, 127, 0.85);
    border: 1px solid rgba(127, 127, 127, 0.85);
    cursor: pointer;
    &.one {
      border-top-left-radius: 5px;
      border-bottom-left-radius: 5px;
    }
    &.two {
      border-top-right-radius: 5px;
      border-bottom-right-radius: 5px;
    }

    &.active {
      color: #10b9b9;
      border: 1px solid rgba(16, 185, 185, 1);
      background-color: rgba(16, 185, 185, 0.15);
    }
  }
  .measure--focus--con {
    width: 100%;
    height: 100%;
    overflow-y: auto;
  }
}
/*滚动条样式*/
.measure--focus--con::-webkit-scrollbar {
  width: 8px;
  /*height: 4px;*/
}
.measure--focus--con::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  background: #fff;
}
.measure--focus--con::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 0;
  background: rgb(85, 83, 83);
}
</style>
